/**
 * Copyright (c) 2016-2019 shdxhl All rights reserved.
 *
 * https://blog.csdn.net/lishangke
 *
 * 版权所有，侵权必究！
 */

package com.xhl.oauth2.datasource.config;

import com.xhl.oauth2.datasource.utils.DynamicContextUtils;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * 多数据源
 *
 * @author lisk wlsk131420@gmail.com
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        return DynamicContextUtils.peek();
    }

}
